#@tabLayout()

#define main()
<div style="">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 教师评价管理 <span class="c-gray en">&gt;</span> 请假详情 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="page-container">
		<form action="#(baseUrl)/ratingScale/save" id="form-ratingScale-save">
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius" onclick="ratingScale_save()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 保存评分</a></span></div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort" id="ratingScale-table">
				<thead>
					<tr class="text-c">
						<th>教师编号</th>
						<th>教师姓名</th>
						<th>课程名称</th>
						<th>评分</th>
					</tr>
				</thead>
			</table>
		</div>
		</form>
	</div>
</div>
#end

#define js()
<script type="text/javascript">

var ratingScale_table = $('#ratingScale-table').DataTable({
	"processing": true,
	"serverSide": true,
	"ajax":"#(baseUrl)/ratingScale/list",
	"columns": [
		{"data":"Teacher_ID",},
		{"data":"Teacher_name"},
		{"data":"Course_name"},
		{
			"data":null,
			"render":function(data,type,full,meta){
				if(full.Score != null) return full.Score;
				return '<input name="ID_'+full.Teacher_ID+'" class="input-text" placeholder="请输入评分（0-100整数）">';
			}
		}
	]
});

$("#form-ratingScale-save").submit(function(e){
	var postData = $(this).serializeArray();
	var formUrl = $(this).attr("action");
	$.ajax({
		url: formUrl,
		type: "POST",
		data: postData,
		success:function(data){
			layer.msg('评价成功',{time:1000});
			ratingScale_table.ajax.reload();
		},
		error:function(jqXHR, textStatus, errorThrown){
			$.Huimodalalert('保存失败',2000);
		}
	});
	e.preventDefault(); 
});
function ratingScale_save(){
	$("#form-ratingScale-save").submit();
}

</script>
#end